export const NodeTypes = {
  FLOW: {
    BASIC: 'basic_flow',
    HOLLOW: 'hollow_flow',
    SOLID: 'solid_flow'
  },
  PROCESS: 'process',
  PRODUCT: 'product'
};

export const NodeConfigs = {
  [NodeTypes.FLOW.BASIC]: {
    type: 'flow',
    subType: 'basic',
    width: 150,
    height: 120,
    displayName: '流程节点',
    borderColor: '#48bb78',
    inputs: [
      { name: '输入', type: 'exec' }
    ],
    outputs: [
      { name: '输出', type: 'exec' }
    ]
  },
  [NodeTypes.FLOW.HOLLOW]: {
    type: 'flow',
    subType: 'hollow',
    width: 150,
    height: 120,
    displayName: '流程节点',
    borderColor: '#48bb78',
    inputs: [
      { name: '输入', type: 'exec' }
    ],
    outputs: [
      { name: '输出', type: 'exec' }
    ]
  },
  [NodeTypes.FLOW.SOLID]: {
    type: 'flow',
    subType: 'solid',
    width: 150,
    height: 120,
    displayName: '流程节点',
    borderColor: '#48bb78',
    inputs: [
      { name: '输入', type: 'exec' }
    ],
    outputs: [
      { name: '输出', type: 'exec' }
    ]
  },
  [NodeTypes.PROCESS]: {
    type: 'procedure',
    width: 150,
    height: 120,
    displayName: '过程节点',
    borderColor: '#4299e1',
    inputs: [
      { name: '执行', type: 'exec' },
      { name: '数据', type: 'data' }
    ],
    outputs: [
      { name: '输出', type: 'exec' }
    ]
  },
  [NodeTypes.PRODUCT]: {
    type: 'product',
    width: 180,
    height: 160,
    displayName: '产品节点',
    borderColor: '#9f7aea',
    inputs: [
      { name: '执行', type: 'exec' }
    ]
  }
};

export const ConnectionRules = {
  [NodeTypes.FLOW.BASIC]: {
    canConnectTo: [NodeTypes.FLOW.BASIC, NodeTypes.FLOW.HOLLOW, NodeTypes.FLOW.SOLID, NodeTypes.PROCESS]
  },
  [NodeTypes.FLOW.HOLLOW]: {
    canConnectTo: [NodeTypes.FLOW.BASIC, NodeTypes.FLOW.HOLLOW, NodeTypes.FLOW.SOLID, NodeTypes.PROCESS]
  },
  [NodeTypes.FLOW.SOLID]: {
    canConnectTo: [NodeTypes.FLOW.BASIC, NodeTypes.FLOW.HOLLOW, NodeTypes.FLOW.SOLID, NodeTypes.PROCESS]
  },
  [NodeTypes.PROCESS]: {
    canConnectTo: [NodeTypes.PRODUCT, NodeTypes.FLOW.HOLLOW, NodeTypes.FLOW.BASIC, NodeTypes.FLOW.SOLID]
  },
  [NodeTypes.PRODUCT]: {
    canConnectTo: []
  }
};